package com.example.demo.utils;

import com.example.demo.domain.Result;

/**
 * @author 王盼
 * @create 2018-11-19 14:00
 */
public class ResultUtil {
  public static Result success(Object object) {
    Result result = new Result();
    result.setCode(0);
    //code返回码
    result.setMsg("成功");
    result.setData(object);
    return result;
  }
  public static Result success() {
    return success(null);
  }

  public static Result error(Integer code, String msg) {
    Result result = new Result();
    result.setCode(code);
    result.setMsg(msg);
    return result;
  }
}